/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package listeners;

import diagram.Node;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JTextField;
import model.DiagramModel;

/**
 *
 * @author Jelle
 */
public class TextFieldListener implements ActionListener {
    private Node node;
    private DiagramModel model;
    private int modus;
    private String s;

    public TextFieldListener(Node node, String s, DiagramModel model){
        this.node = node;
        this.s=s;
        this.model = model;
        
    }
    public void actionPerformed(ActionEvent e) {
        JTextField f = (JTextField)e.getSource();
        model.editNode(node, f.getText(), s);
    }

}
